package net.jjjshop.front.scheduled;

import lombok.extern.slf4j.Slf4j;
import net.jjjshop.common.service.lbt.LbLotteryOrderService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

@Slf4j
@Component
@EnableScheduling // 2.开启定时任务
public class LotterySceduled {
    @Autowired
    private LbLotteryOrderService lotteryOrderService;
    private static final Logger logger = LoggerFactory.getLogger(LotterySceduled.class);

    @Scheduled(cron = "50 59 19 * * ?")
    public void init(){
        logger.info("执行抽奖任务------");
        lotteryOrderService.getQueryLottery2();
        logger.info("执行抽奖任务已完成------");
}
}
